package cn.four.hqServer.modules.withdraw.mapper;


import cn.four.hqServer.common.entity.HqTranUser;
import cn.four.hqServer.common.entity.HqYhTran;
import cn.four.hqServer.common.entity.HqCardInfo;
import cn.four.hqServer.modules.withdraw.dto.WithdrawDto;
import org.apache.ibatis.annotations.Mapper;

import java.math.BigDecimal;

/**
* @author xqx
* @description 针对表【hq_card_info】的数据库操作Mapper
* @createDate 2023-02-23 14:01:37
* @Entity withdraw.entity.HqCardInfo
*/
@Mapper
public interface XqxHqCardInfoMapper {

    //    1.根据银行卡号判断账户状态吗，正常-0、透支-1、冻结-2、注销-3
    int checkStateByCardId(WithdrawDto withdrawDto);
    //    2.核对银行卡号和取款密码
    String checkCardPassword(WithdrawDto withdrawDto);
    //    3.比较取款金额是否符合要求
    BigDecimal compareBalance(WithdrawDto withdrawDto);
    //    4.将数据插入用户流水表中
    int insertTU(HqTranUser hqTranUser);

    //    5.将数据插入现金流水表中
    int insertT(HqYhTran hqYhTran);

    //    6.更新账户余额
    int updateCI(HqCardInfo hqCardInfo);

    //    7.冻结账户状态
    int updateCardState(HqCardInfo hqCardInfo);


}
